from marshmallow import fields

from webutils.marshmallow.fields import EnumField
from webutils.marshmallow.models import Model

from . import const


class UnitInfo(Model):
    id = fields.Str()
    type = EnumField(const.UnitType)
    course_id = fields.Str()
    status = EnumField(const.UnitStatus)


class UserInfo(Model):
    id = fields.Str()
    name = fields.Str()
    third_part_id = fields.Str(required=False)
    role = EnumField(const.UserRole)


class DeviceInfo(Model):
    id = fields.Str()
    name = fields.Str()
    type = EnumField(const.DeviceType)
    classroom_id = fields.Str()
